package com.shiro.demo3.utils;

import lombok.Data;

@Data
public class R {
    private Integer code;
    private String msg;
    private Object data;
    private R(){}
    public static R success(){
        R r = new R();
        r.setCode(1);
        r.setMsg("成功!");
        return r;
    }
    public static R fail(){
        R r = new R();
        r.setCode(0);
        r.setMsg("失败!");
        return r;
    }
    public R code(Integer code){
        this.setCode(code);
        return this;
    }
    public R msg(String msg){
        this.setMsg(msg);
        return this;
    }
    public R data(Object data){
        this.setData(data);
        return this;
    }
}